﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using COFE.Core;

namespace COFE.Core.Lister
{
    public class RootDirectoryParentPropertyProvider : IPropertyProvider
    {
        #region Constructors

        public RootDirectoryParentPropertyProvider(IUserProfile profile,  IDirectoryInfoExA dir)
        {
            _dir = dir;
            _profile = profile;
        }

        #endregion

        #region Methods

        public object[] GetSupportedProperty()
        {
            return new object[] {
               FileSystemInfoProperties.Parent
            };
        }

        public bool IsPropertyReadOnly(object property)
        {
            return true;
        }


        public bool IsPropertySupported(object propertyType)
        {
            return propertyType.Equals(FileSystemInfoProperties.Parent);
        }

        public PropertyPair GetProperty(object property)
        {
            if (property.Equals(FileSystemInfoProperties.Parent))
            {
                return new PropertyPair(property, _profile.ProfileRootDirectory);
            }
            throw new NotSupportedException(property.ToString());

        }

        public void SetProperty(object propertyType, object value)
        {
            throw new NotImplementedException();
        }
        #endregion

        #region Data

        private IUserProfile _profile;
        private IDirectoryInfoExA _dir;

        #endregion


    }

}
